import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import seaborn as sns
#import data from txt
a=np.loadtxt('a.txt')
xlenth=a.shape[1]
#tlenth=a.shape[0]
tlenth=20
x=np.arange(0,xlenth,1)


sns.set_style("whitegrid")
fig,ax=plt.subplots()
fig.set_tight_layout(True)

line,=ax.plot(x,a[1,:])

def update(i):
    plt.cla()
    line,=ax.plot(x,a[i,:])
    return line,

anim=FuncAnimation(fig,update,frames=np.arange(0,tlenth,1),interval=1)
plt.show()
